package net.maku.module.service.impl;

import net.maku.module.dao.AgHomeConfigurationMapper;
import net.maku.module.entity.AgHomeConfiguration;
import net.maku.module.service.AgHomeConfigurationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AgHomeConfigurationServiceImpl implements AgHomeConfigurationService {

    @Autowired
    private AgHomeConfigurationMapper mapper;

    public AgHomeConfiguration getByIdAndWebsite(Integer id, Integer websiteId) {
        return mapper.selectByIdAndWebsite(id, websiteId);
    }

    public List<AgHomeConfiguration> getByWebsiteId(Integer websiteId) {
        return mapper.selectByWebsiteId(websiteId);
    }

    public int addConfig(AgHomeConfiguration config) {
        return mapper.insertConfig(config);
    }

    public int updateConfig(AgHomeConfiguration config) {
        return mapper.updateConfig(config);
    }

    public int deleteConfig(Integer id, Integer websiteId) {
        return mapper.deleteConfig(id, websiteId);
    }
}